Find obj between Dates

I have a doubt.

I want to get all objs which the modification date is between two different dates, and that dont meet certain conditions.
I think the problem is in a specific part of the dxl ... this part:

void countValidReqmts(){

Item selItem
int selItemToken
Module selMod
string itemNoteStr
Object itemObj
int objCounter
Date selectedDate
 
selectedDate = dateAndTime(getDate(dateSelect))
selectedDate2 = dateAndTime(getDate(dateSelect2))
 
for (selItemToken=0; selItemToken<noElems(selectedListView); selItemToken++) {
raise(selectModulesDB)
itemNoteStr = getColumnValue(selectedListView, selItemToken, 2)
 
if (itemNoteStr == "Applicable") {
// Only runs if previously detected as applicable
objCounter = 0
selItem = item(get(selectedListView, selItemToken))
selMod = read(rootName_(selItem), false, false)
current = selMod
filtering off
 
for itemObj in selMod do {
if (itemObj."Validation Status" "" == "Valid") {
// Find if Valid
                    if (itemObj."EPR ID" "" != "") {
  
if( get(dateUsedToggle) ) {
if (findIfTextChangedAfter(selectedDate, selMod, itemObj)){
 
   if( get(dateUsedToggle2) ){
                        if(findIfTextChangedBefore(selectedDate2, selMod, itemObj)) {
   // If validated before date
accept(itemObj)
objCounter++
}
}
else {
reject(itemObj)
   }
}
                }
else {
reject(itemObj)
}
}
else {
reject(itemObj)
}
}
       else {
reject(itemObj)
}
 
set(selectedListView, selItemToken, 2, objCounter "")
refresh selMod 
}
}
}

}

If anyone can help me, or give me an idea ... I kind of got stuck in a line of reasoning and I cant think of anything else.

Thanks!


braolive - Fri Sep 06 14:18:20 EDT 2013

Re: Find obj between Dates
llandale - Fri Sep 06 14:30:25 EDT 2013

This is hard to follow, but

  • you will need a "filtering on" before "refresh selMod". 
  • I would load the Standard view with this change: selMod = read(rootName_(selItem), false, true)
  • If you want to see these objects, then open it visibly: selMod = read(rootName_(selItem), true, true)
  • I would "reject(itemObj)" at the top of the loop, and "accept" it if it qualifies.  I think that is easier to understand than all those else statements.

-Louie